<?php
    $data = $this -> supplement;
?>

<div class='center_form'>
    <div class="center_form_right">      
        <div class='center_form_btn_div' onclick='javascript:Common.gotoUrl("<?php echo HttpUtil::baseUrl();?>/trade/supplement/index");'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/cancel.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("returnBtn"); ?></div>
        </div>
    </div>
    <?php if(AAService::isAllowed("supplement", "deny")) { ?>
    <div class="center_form_right">      
        <div class='center_form_btn_div' onclick='javascript:Supplement.showRejectDialog();'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/delete.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("deny"); ?></div>
        </div>
    </div>
    <?php } ?>
    <?php if(AAService::isAllowed("supplement", "approved")) { ?>
    <div class="center_form_right">      
        <div class='center_form_btn_div' onclick='javascript:$("#approvedForm").submit();$(this).attr("onclick","");'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/save.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("approved"); ?></div>
        </div>
    </div>   
    <?php } ?>     
</div>

<div class="clear"></div>
<div class="centerbig_form">
      <div class="center_top"><span class="center_top_title"><?php echo $this->translate("pending"); ?></span></div>
      <div class="right_form_content">

               <div class="form_content">
               <form action="<?php echo HttpUtil::baseUrl();?>/trade/supplement/approved" method="post" id="approvedForm">
               <input type="hidden" name="id" value="<?php echo $data['id']; ?>" />
               <input type="hidden" name="user_id" value="<?php echo $data['user_id']; ?>" />
               <input type="hidden" name="trade_sum" value="<?php echo $data['trade_sum']; ?>" />
                        <table cellspacing="0" cellpadding="0" border="0" class="order_table">
				            <tr>
				                <td class="table_header"><?php echo $this->translate("sn"); ?></td>
				                <td><?php echo $data["sn"]; ?></td>
				                <td class="table_header"><?php echo $this->translate("trade_num"); ?></td>
				                <td><?php echo $data['trade_num']; ?></td>
				            </tr>
				            <tr>
				                <td class="table_header"><?php echo $this->translate("account"); ?></td>
				                <td><?php echo $data['uname']; ?></td>
				                <td class="table_header"><?php echo $this->translate("trade_sum"); ?></td>
				                <td><?php echo $data['trade_sum']; ?></td>
				            </tr>
				            <tr>
				                <td class="table_header"><?php echo $this->translate("off_supplement_type"); ?></td>
				                <td><?php echo TradeConstant::getType($data['supplement_type']); ?></td>
				                <td class="table_header"><?php echo $this->translate("out_id"); ?></td>
				                <td><?php echo $data['out_id']; ?></td>
				            </tr>
				            <tr>
				                <td class="table_header"><?php echo $this->translate("out_name"); ?></td>
				                <td><?php echo $data['out_name']; ?></td>
				                <td class="table_header"><?php echo $this->translate("out_date"); ?></td>
				                <td><?php echo $data['out_date']; ?></td>
				            </tr>
				            <tr>
				                <td class="table_header"><?php echo $this->translate("in_id"); ?></td>
				                <td colspan="3"><?php echo $data['in_id']; ?></td>                               
				            </tr>                       
                        </table>
               </form>
               </div>
 
      </div>
      <div class='clear'></div>
</div>
<div class='clear'></div>
<div id="rejectDialog" style="display: none;">
    <form action="<?php echo HttpUtil::baseUrl();?>/trade/supplement/deny" method="post" id="denyForm">
         <input type="hidden" name="id" value="<?php echo $data['id']; ?>" />
         <table cellspacing="5" cellpadding="0" border="0">
            <tr>
                <td valign="top">
                   <?php echo $this->translate("desctiption"); ?>
                </td>
                <td>
                    <textarea rows="5" cols="25" name="desctiption"></textarea>
                </td>
            </tr>
            <tr align="center">
                <td colspan="2">
                    <input type="button" onclick='javascript:$("#denyForm").submit();' value="<?php echo $this->translate("confirmBtn"); ?>"/>
                    &nbsp;   
                    <input type="button" onclick='javascript:$("#rejectDialog").dialog("close");' value="<?php echo $this->translate("cancelBtn"); ?>" />                
                </td>          
            </tr>
         </table>
     </form>
</div>